home *** CD-ROM | disk | FTP | other *** search
/ Aminet 28 / Aminet 28 (1998)(GTI - Schatztruhe)[!][Dec 1998].iso / Aminet / dev / misc / gms_dev.lha / GMSDev / Includes / files / segments.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-06-01  |  1.9 KB  |  70 lines

  1. #ifndef FILES_SEGMENTS_H
  2. #define FILES_SEGMENTS_H TRUE
  3.  
  4. /*
  5. **   $VER: segments.h (June 1998)
  6. **
  7. **   Segment Definitions.
  8. **
  9. **   (C) Copyright 1996-1998 DreamWorld Productions.
  10. **       All Rights Reserved.
  11. */
  12.  
  13. #ifndef DPKERNEL_H
  14. #include <dpkernel/dpkernel.h>
  15. #endif
  16.  
  17. /****************************************************************************
  18. ** Segment object.
  19. */
  20.  
  21. #define VER_SEGMENT  2
  22. #define TAGS_SEGMENT (ID_SPCTAGS<<16)|ID_SEGMENT
  23.  
  24. typedef struct Segment {
  25.   struct Head Head;        /* [00] Standard structure header */
  26.   struct Segment *Prev;    /* [12] Previous segment */
  27.   struct Segment *Next;    /* [16] Next segment */
  28.   LONG   MemType;          /* [20] Memory type (eg MEM_DATA) */
  29.   APTR   Address;          /* [24] Pointer to segment start */
  30.   struct FileName *Source; /* [28] Source of segment */
  31.   WORD   CPU;              /* [32] The CPU type if it is a MEM_CODE segment */
  32.   WORD   emp;              /* [34] */
  33.   LONG   Size;             /* [36] Total size of the segment in bytes */
  34.  
  35.   /* Private fields below */
  36.  
  37.   APTR   prvDOSSeg;
  38. } OBJ_SEGMENT;
  39.  
  40. #define SGA_Prev    (12|TAPTR)
  41. #define SGA_Next    (16|TAPTR)
  42. #define SGA_MemType (20|TLONG)
  43. #define SGA_Address (24|TAPTR)
  44. #define SGA_Source  (28|TAPTR)
  45. #define SGA_CPU     (32|TWORD)
  46. #define SGA_Size    (36|TLONG)
  47.  
  48. /****************************************************************************
  49. ** This structure is identical to the standard segment struct but defines
  50. ** the Address as a function (ANSI-C prevents function<->data type
  51. ** conversion).
  52. */
  53.  
  54. typedef struct CodeSegment {
  55.   struct Head Head;
  56.   struct Segment *Prev;
  57.   struct Segment *Next;
  58.   LONG   MemType;
  59.   LIBPTR void (*Address)(mreg(__d0) LONG ID, mreg(__d1) LONG Version,
  60.            mreg(__d2) LONG Revision, mreg(__a1) struct DPKBase *DPKBase,
  61.            mreg(__a0) BYTE *Arguments);
  62.   struct FileName *Source;
  63.  
  64.   /*** Private fields below ***/
  65.  
  66.   APTR   prvDOSSeg;
  67. } OBJ_CODESEGMENT;
  68.  
  69. #endif /* FILES_SEGMENTS_H */
  70.